package com.sharesrc.umangadownloader.shared.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class MangaSiteInfo implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 201307081524L;

	private String id;
	private String name;
	private String childSiteId;
	private int pageCount;
	private int mangaCount;
	private List<Boolean> lstIsPageUpdated;

	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getChildSiteId() {
		return this.childSiteId;
	}

	public void setChildSiteId(String childSiteId) {
		this.childSiteId = childSiteId;
	}

	public int getPageCount() {
		return this.pageCount;
	}

	public void setPageCount(int pageCount) {
		this.pageCount = pageCount;
	}

	public int getMangaCount() {
		return this.mangaCount;
	}

	public void setMangaCount(int mangaCount) {
		this.mangaCount = mangaCount;
	}

	public List<Boolean> getLstIsPageUpdated() {
		return this.lstIsPageUpdated;
	}

	public void setLstIsPageUpdated(List<Boolean> lstIsPageUpdated) {
		this.lstIsPageUpdated = lstIsPageUpdated;
	}

	public MangaSiteInfo() {
		super();
		this.id = "";
		this.name = "";
		this.childSiteId = "";
		this.pageCount = 0;
		this.mangaCount = 0;
		this.lstIsPageUpdated = new ArrayList<Boolean>();
	}

	public MangaSiteInfo(String name) {
		super();
		this.id = "";
		this.name = name;
		this.pageCount = 0;
		this.mangaCount = 0;
		this.lstIsPageUpdated = new ArrayList<Boolean>();
	}

	public MangaSiteInfo(String name, String childSiteId) {
		super();
		this.id = "";
		this.name = name;
		this.childSiteId = childSiteId;
		this.pageCount = 0;
		this.mangaCount = 0;
		this.lstIsPageUpdated = new ArrayList<Boolean>();
	}

	public MangaSiteInfo(String id, String name, int pageCount, int mangaCount) {
		super();
		this.id = id;
		this.name = name;
		this.pageCount = pageCount;
		this.mangaCount = mangaCount;
		this.lstIsPageUpdated = new ArrayList<Boolean>(pageCount);
	}

	public MangaSiteInfo(String id, String name, String childSiteId, int pageCount, int mangaCount) {
		super();
		this.id = id;
		this.name = name;
		this.childSiteId = childSiteId;
		this.pageCount = pageCount;
		this.mangaCount = mangaCount;
		this.lstIsPageUpdated = new ArrayList<Boolean>(pageCount);
	}

	public void setPageUpdated(int pageIndex) {
		try {
			this.lstIsPageUpdated.set(pageIndex, Boolean.TRUE);
		} catch (IndexOutOfBoundsException e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
